<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width"/>
<meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
<title>全部佣金</title>
<link rel="stylesheet" type="text/css" href="../../css/aui-flex.css" />
<link rel="stylesheet" type="text/css" href="../../css/aui.css" />
<link rel="stylesheet" type="text/css" href="../../css/common.css" />
<style>
body{
  background: #F5F7F8;
}
.aui-content{
  padding: 0 0.75rem;
  background: #fff;
}
.tit{
  font-size: 0.6rem;
  color: #373336;
  padding: 0.6rem 0;
  text-align: center;
  background: #F5F7F8;
}
.notice{
  padding: 0.8rem 0.25rem 0.3rem;
}
.inner{
  padding: 0 1.4rem;
  font-size: 0.6rem;
  color: #FF8028;
  text-align: left;
  background: #FFF1E5;
  border: 1px solid #FFC9AE;
  border-radius: 4px;
}
.inner .padded-tb{
  padding: 0.55rem 0;
}
.dotted{
  border-bottom: 2px dotted  #FFC9AE;
}
.orderInfo{
  padding: 0.8rem 0;
}
.orderInfo .top-name .head > img{
  border-radius: 50%;
  margin-right: 0.3rem;
}
.member {
  width: 2.8rem;
  height: 0.7rem;
  display: inline-block;
  margin-left: 0.7rem;
}
.member.tag-pt {
  /*background: url('../../image/mine/2.png') no-repeat;
  background-size: auto 0.7rem;*/
}
.member.tag-y {
  background: url('../../image/mine/2.png') no-repeat;
  background-size: auto 0.7rem;
}

.member.tag-vip {
  background: url('../../image/mine/3.png') no-repeat;
  background-size: auto 0.7rem;
}

.member.tag-cj {
  background: url('../../image/mine/4.png') no-repeat;
  background-size: auto 0.7rem;
}
.payBtn{
  height: 0.9rem;
  line-height: 1rem;
  padding: 0rem 0.5rem;
  background: #FA7D83;
  text-align: center;
  font-size:0.5rem;
  color:#fff;
  border-radius: 0.1rem;
}
.moneyBox{
  padding-top: 0.5rem;
}
.media{
  width: 3.6rem;
  height: 3.6rem;
  margin-right: 0.4rem;
}
.media-tab2{
  width: 2.5rem;
  height: 2.5rem;
}
.notData{
  text-align: center;
  min-height: 90%;
  position: absolute;
  width: 100%;
  padding: 3.4rem 1rem 0;
}
.notImg{
  height: 7rem;
  margin: 0 auto;
}
.notBtn{
  background: #E73450;
  border-radius: 5rem;
  height: 2.5rem;
  color:#fff;
  font-size:0.7rem;
  text-align: center;
  line-height: 2.5rem;
}
.padded-tb-32{
  padding-top: 1.6rem;
  padding-bottom: 1.2rem;
}
.full-tab{
  height: 3.2rem;
  text-align: center;
}
.full-tab li{
  width: 5.6rem;
  background: #fff;
  margin-left:0.5rem;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  background-color: rgba(255, 255, 255, 1);
  box-shadow: 0px -2px 4px 0px rgba(0, 0, 0, 0.05);
  padding: 0.6rem 0;
}
.full-tab li.full-active{
background-color: rgba(255, 255, 255, 0.8);

}
.full-tab li p{
  color: #363436;
}
.orderInfo .tag {
  margin-top: -0.1rem;
  margin-right: 0.4rem;
  display: inline-block;
  color: #FFF;
  background: #FA7D83;
  border-radius: 0.1rem;
  font-size: 0.4rem;
  padding: 0 0.15rem;
  line-height: 0.75rem;
  vertical-align: middle;
}

.orderInfo .tag.on {
  background: #FFC667;
}
.line-h{
  line-height: 2;
}
.aui-hide{
  display: none !important;
}

</style>
</head>
<body>
  <div class="tit" tapmode onclick="openZc()">每月22日，结算上个月「<span id="txt">结算收货</span>」的订单。了解具体>></div>
  <ul class="full-tab aui-flex-col" id="type-tab">
    <li tapmode onclick="getIncomeList(1)">
      <p class="aui-font-size-12">分享佣金(元)</p>
      <p class="aui-font-size-18 color-333 text-bold" id="shareIncome">0</p>
    </li>
    <li class="full-active" tapmode onclick="getIncomeList(2)">
      <p class="aui-font-size-12">A级团队(元)</p>
      <p class="aui-font-size-18 color-333 text-bold" id="teamIncome">0</p>
    </li>
  </ul>
  <!-- 无奖励明细显示 -->
  <div class="notData aui-hide bg-white">
    <img src="../../image/notdata/12.png" class="notImg" alt="">
    <div class="aui-font-size-14 color-ad" id="txt1">暂无您的团队佣金</div>
    <div class="aui-font-size-12 color-35 padded-tb-32" id="txt2">去教教您的团队如何推广成交吧！</div>
    <div class="notBtn" tapmode onclick="openZc()">有蜜 学习讲堂</div>
  </div>

  <div class="aui-content">

    <div id="data_html">

    </div>
    <script type="text/x-dot-template" id="data_tpl">
      {{ for(var i in it){ }}
      <div class="orderInfo aui-padded-t-5 aui-border-b">
        <div class="date aui-font-size-12 color-ad aui-padded-t-10 aui-padded-b-10">
        {{if(it[i].data_type ==1){}}
        <span class="tag on">淘宝客</span>
        {{}else if(it[i].data_type ==2){}}
        <span class="tag">大礼包</span>
        {{} else if(it[i].data_type ==3){}}
        <span class="tag on">自营商品</span>
        {{}}}
        {{=it[i].create_time}}<span>创建</span>
        </div>
        <div class="aui-flex-col">
          <div class="media"><img src="{{=it[i].pict_url}}" class="shopImg" alt=""></div>
          <div class="flex-auto">
            <div class="aui-flex-col aui-flex-between">
              <div class="aui-font-size-12 color-000 flex-auto aui-ellipsis-2">{{=it[i].title}}</div>
              <div></div>
              {{if(it[i].tk_status == 15){ }}
              <div class="payBtn">已结算</div>
              {{ } else if(it[i].tk_status == 12){ }}
              <div class="payBtn">已付款</div>
              {{ } else if(it[i].tk_status == 13){ }}
              <div class="payBtn" style="background: #ccc">已失效</div>
              {{ } else if(it[i].tk_status == 3){ }}
              <div class="payBtn">已收货待结算</div>
              {{}}}
            </div>
            <div class="moneyBox aui-flex-col aui-flex-between">
              <div class="color-666 flex-auto aui-font-size-12">买家付款金额<span>￥{{=it[i].pay_price}}</span></div>
              <div class="color-e7 aui-font-size-12 aui-ellipsis">
                {{if(it[i].tk_status == 3){ }}
                  分享佣金正在
                  <span class="aui-padded-l-5">计算中</span>
                {{ } else { }}
                  分享佣金
                  <span class="aui-padded-l-5">￥{{=it[i].data_commission || '0.00'}}</span>
                {{}}}
              </div>
            </div>
          </div>
        </div>
      </div>
      {{ } }}
    </script>
    <div id="data_html_A">

    </div>
    <script type="text/x-dot-template" id="data_tpl_A">
      <div class="notice">
        <div class="inner">
          <div class="padded-tb">为保护他人隐私，团队佣金不展示具体购买的商品~</div>
          <div class="dotted"></div>
          <div class="padded-tb" tapmode onClick="openvipInvio()">升级为运营商，即可获得B级及以下层级的奖励。</div>
        </div>
      </div>
      {{ for(var i in it){ }}
      <div class="orderInfo aui-border-b">
            <div class="aui-flex-col top-name aui-flex-middle">
              <div class="head"><img src="{{=it[i].user_avatar}}" style="height:1rem" alt=""></div>
              <div class="aui-font-size-12 color-35 userName">{{=it[i].user_nickname}}</div>
              {{ if(it[i].user_vip == 1){}}
              <div class="member tag-pt"></div>
              {{}else if(it[i].user_vip == 2){}}
              <div class="member tag-vip"></div>
              {{}else if(it[i].user_vip == 3){}}
              <div class="member tag-y"></div>
              {{}else if(it[i].user_vip == 4){}}
              <div class="member tag-cj"></div>
              {{}}}
            </div>
            <div class="date aui-font-size-12 color-ad aui-padded-t-10 aui-padded-b-10">
            {{if(it[i].data_type ==1){}}
            <span class="tag on">淘宝客</span>
            {{}else if(it[i].data_type ==2){}}
            <span class="tag">大礼包</span>
            {{} else if(it[i].data_type == 3){}}
            <span class="tag on">自营商品</span>
            {{}}}
            {{=it[i].create_time}} <span>创建</span></div>
            <div class="aui-flex-col">
            {{if(it[i].data_type == 1){}}
              <div class="media"><img src="../../image/common/tkLogo.png" class="shopImg" alt=""></div>
            {{}else{}}
              <div class="media"><img src="../../image/common/applogo02.jpg" class="shopImg" alt=""></div>
            {{}}}

              <div class="flex-auto">
                <div class="aui-flex-col aui-flex-between">
                {{if(it[i].data_type ==1){}}
                  <div class="aui-font-size-12 color-000 flex-auto aui-ellipsis-2">用户自选商品</div>
                {{}else{}}
                  <div class="aui-font-size-12 color-000 flex-auto aui-ellipsis-2">有蜜精选商品</div>
                {{}}}
                  <div></div>
                  {{if(it[i].tk_status == 15){ }}
                  <div class="payBtn">已结算</div>
                  {{ } else if(it[i].tk_status == 12){ }}
                  <div class="payBtn">已付款</div>
                  {{ } else if(it[i].tk_status == 13){ }}
                  <div class="payBtn" style="background: #ccc">已失效</div>
                  {{ } else if(it[i].tk_status == 3){ }}
                  <div class="payBtn">已收货待结算</div>
                  {{}}}
                </div>
                <div class="moneyBox aui-flex-col aui-flex-between">
                  <div class="color-666 aui-font-size-12">买家付款金额<span>￥{{=it[i].pay_price}}</span></div>
                  <div class="color-e7 aui-font-size-12">团队佣金<span>￥{{=it[i].data_commission || '0.00'}}</span></div>
                </div>
              </div>
            </div>
          </div>
      {{ } }}
    </script>

  </div>

  <!-- <div class="aui-content aui-hide" id="tab2">
    <div class="notice">
      <div class="inner">
        <div class="padded-tb">为保护他人隐私，团队奖励不展示具体购买的商品~</div>
        <div class="dotted"></div>
        <div class="padded-tb" tapmode onClick="openvipInvio()">升级为运营商，即可获得B级及以下层级的奖励。</div>
      </div>
    </div>
    <div class="orderInfo aui-border-b">
      <div class="aui-flex-col top-name aui-flex-middle">
        <div class="head"><img src="../../image/demo/02.jpg" style="height:1rem" alt=""></div>
        <div class="aui-font-size-12 color-35">不吃与的猫</div>
        <div class="member"><img src="../../image/mine/3.png" alt=""></div>
      </div>
      <div class="date aui-font-size-12 color-ad aui-padded-t-10 aui-padded-b-10"><span class="tag">大礼包</span>2018.08.07  16:26:46 <span>创建</span></div>
      <div class="aui-flex-col">
        <div class="media media-tab2"><img src="../../image/demo/02.jpg" class="shopImg" alt=""></div>
        <div class="flex-auto">
          <div class="aui-flex-col aui-flex-between">
            <div class="aui-font-size-14 color-000">用户自选</div>
            <div class="payBtn">已付款</div>
          </div>
          <div class="moneyBox aui-flex-col aui-flex-between">
            <div class="color-666 aui-font-size-12">买家付款金额<span>￥876</span></div>
            <div class="color-e7 aui-font-size-12">团队奖励<span>￥9.00</span></div>
          </div>
        </div>
      </div>
    </div>
  </div> -->
</body>
<script type="text/javascript" src="../../script/import.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript">
var num = 1;
var DATA_TYPE = 0;
var index;
apiready = function(){
	api.parseTapmode();
  getIncomeList(num);
  var userInfo = getUserinfo();
  index = api.pageParam.index;
	if(index){
    changeItem(index)
	}

};
function changeItem(n){
	switch (n) {
		case 0:
			DATA_TYPE = 0;
			break;
		case 1:
			DATA_TYPE = 1;
			break;
		case 2:
			DATA_TYPE = 2;
			break;
		case 3:
			DATA_TYPE = 3;
			break;
		default:
			DATA_TYPE = 0;
	}
  getIncomeList(num)
}
function getIncomeList(ind) {
    $$('#type-tab > li').addClass('full-active').eq(ind).removeClass('full-active');
    if(ind == 1){
      $$('#txt').text('结算收货');
      $$('#txt1').text('暂无您的分享佣金')
      $$('#txt2').text('快去分享赚钱，明天更新数据，保准您有惊喜!')
    }
    if(ind == 2){
      $$('#txt').text('确认收货')
      $$('#txt1').text('暂无您的团队佣金')
      $$('#txt2').text('去教教您的团队如何推广成交吧!')
    }
    api.ajax({
        url: BASE_URL + 'App/Commission/orderTeam',
        method: 'post',
        data: {
            values: {
                userid: getUserId(),
                type: ind,
                data_type: DATA_TYPE
            }
        }
    },function(ret, err){
        if (ret && ret.code == 1) {
          $$('.notData').addClass('aui-hide');
          if(ind == 1){
            $$('#data_html_A').addClass('aui-hide')
            $$('#data_html').removeClass('aui-hide')
            var tpl = $$('#data_tpl').html();
            var tempFn = doT.template(tpl);
            $$('#data_html').html(tempFn(ret.data));
          }
          if(ind == 2){
            $$('#data_html').addClass('aui-hide')
            $$('#data_html_A').removeClass('aui-hide')
            var tpl1 = $$('#data_tpl_A').html();
            var tempFn1 = doT.template(tpl1);
            $$('#data_html_A').html(tempFn1(ret.data));
          }

        } else {
          $$('.notData').removeClass('aui-hide')
          $$('#data_html').html('');
          $$('#data_html_A').html('');

        }
        $$('#shareIncome').text(ret.commission || '0');
        $$('#teamIncome').text(ret.commission_2 || '0');
    });

}
// 了解具体（新手课堂）
function openZc(){
  api.openWin({
      name: 'zc_xs_win',
      url: 'zc_xs_win.html',
      pageParam: {
          title: '新手课堂'
      }
  });

}
</script>
</html>
